<template>
	<view>
		<view class="flex-shrink" style="height:110rpx;"></view>
		<view class="fixed-bottom flex shadow" style="height: 110rpx;" :style="{backgroundColor: tabBar.backgroundColor}">
			<view @click="handleTabs(item.pagePath,index)" class="w-100 flex flex-column align-center justify-center" v-for="(item,index) in tabBar.Chidren.list" :key="index">
				<view style="width: 50rpx;height: 50rpx;">
					<image :src="tabId==index? Domain_ICON + item.selectedIconPath : Domain_ICON + item.iconPath" class="w-100" style="height: 100%;" mode="widthFix"></image>
				</view>
				<text class="font-sm" :style="{color:tabId==index ?tabBar.selectedColor:''}">{{item.text}}</text>
			</view>
		</view>
	</view>
</template>
<script>
	const app = getApp();
	export default {
		data() {
			return {
				tabBar: {
					selectedColor: '#dc3545',
					backgroundColor: '#ffffff',
					Chidren:{
						list: [{
							pagePath: "/pages/Merchant/index",
							text: "商城",
							iconPath: "/shop.jpg",
							selectedIconPath: "/shop.jpg"
						},
						{
							pagePath: "/pages/Merchant/Merchant_cat",
							text: "购物车",
							iconPath: "/gwc.jpg",
							selectedIconPath: "/gwc.jpg"
						}, {
							pagePath: "/pages/my/my",
							text: "我的",
							iconPath: "/dkw_my.jpg",
							selectedIconPath: "/dkw_my.jpg"
						}]
					}
				},
				Domain_ICON: app.globalData.Domain_ICON, //全局变量域名
			}
		},
		props:{
			tabId: { //总计金额
				type: Number,
				default: 0
			},
		},
		methods: {
			handleTabs(url,index){//跳转
				if(this.tabId!=index){
					uni.showLoading({
						title: '正在加载...'
					})
					// if(index==0&&app.globalData.memberInfo.Dealer_Authority!=''){
					// 	//判断是否为供应商
					// 	uni.redirectTo({
					// 		url:'/pages/Merchant/index',
					// 		success: (e) => {
					// 			uni.hideLoading();
					// 		},
					// 	})
					// }else{
						uni.redirectTo({
							url,
							success: (e) => {
								uni.hideLoading();
							},
						})
					// }
				}
			},
		}
	}
</script>

<style>

</style>